package com.rabbit.eap.framework.common.exception;

import com.rabbit.eap.framework.common.api.ApiCode;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * @projectName eap
 * @packageName com.rabbit.eap.framework.common.exception
 * @className EapConfigException
 * @author： rabbit
 * @version： 1.0
 * @since： 2020/4/27 22:07
 * <p>Description: EapConfigException
 * Eap 配置异常
 * </p>

 */
@Data
@EqualsAndHashCode(callSuper = true)
public class EapConfigException extends EapException {

    private static final long serialVersionUID = 8952028631871769425L;

    private Integer errorCode;
    private String message;

    public EapConfigException() {
        super();
    }

    public EapConfigException(String message) {
        super(message);
        this.message = message;
    }

    public EapConfigException(Integer errorCode, String message) {
        super(message);
        this.errorCode = errorCode;
        this.message = message;
    }

    public EapConfigException(ApiCode apiCode) {
        super(apiCode.getMessage());
        this.errorCode = apiCode.getCode();
        this.message = apiCode.getMessage();
    }

    public EapConfigException(String message, Throwable cause) {
        super(message, cause);
    }

    public EapConfigException(Throwable cause) {
        super(cause);
    }
}
